﻿namespace etracks.Web
{
    using etracks.EntityModels;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;

    /// <summary>
    /// ViewModel used in EnvironmentController, Index action
    /// </summary>
    public class EnvironmentIndexViewModel
    {
        public int Environments { get; set; }
    }

    /// <summary>
    /// ViewModel used in EnvironmentController, List action
    /// </summary>
    public class EnvironmentListViewModel
    {
        public List<EnvironmentListItem> EnvironmentList { get; set; }

        public int? ProjectId { get; set; }

        public EnvironmentListViewModel()
        {
            this.EnvironmentList = new List<EnvironmentListItem>();
        }
    }

    public class EnvironmentListItem : etracks.EntityModels.Environment
    {
        //p.name  AS "project_name", 
        //p.alias AS "project_alias", 
        //pt.name AS "project_type_name"
        public string ProjectName { get; set; }
        public string ProjectAlias { get; set; }
        public string ProjectTypeName { get; set; }
    }

    /// <summary>
    /// ViewModel used in EnvironmentController, Search action
    /// </summary>
    public class EnvironmentSearchViewModel
    {
        public string Search_Term { get; set; }

        public List<etracks.EntityModels.Environment> EnvironmentList { get; set; }

        public EnvironmentSearchViewModel()
        {
            this.EnvironmentList = new List<etracks.EntityModels.Environment>();
        }
    }

    public class EnvironmentRegistrationViewModel : etracks.EntityModels.Environment
    {
        public List<Project> ProjectList { get; set; }

        public EnvironmentRegistrationViewModel()
        {
            this.ProjectList = new List<Project>();
        }
    }

    public class EnvironmentReadOnlyViewModel : etracks.EntityModels.Environment
    {
        public List<ResourceReadOnlyViewModel> ResourceList { get; set; }

        public EnvironmentReadOnlyViewModel()
        {
            this.ResourceList = new List<ResourceReadOnlyViewModel>();
        }
    }

    public class EnvironmentResourceViewModel : etracks.EntityModels.Environment
    {
        public List<ResourceReadOnlyViewModel> ResourceList { get; set; }

        public EnvironmentResourceViewModel()
        {
            this.ResourceList = new List<ResourceReadOnlyViewModel>();
        }

    }
}
